<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<script type="text/javascript" src="${staticPath}/js/decimalinput.js"></script>
<link rel="stylesheet"
	href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css"
	type="text/css">
<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js"
	type="text/javascript"></script>
<script src="${staticPath}/js/jQuery.FillOptions.js"></script>
<script type="text/javascript" src="${staticPath}/js/contract_list.js"></script>
<script type="text/javascript">
	var storeId1 = "";
	var floorId1 = "";
	var formart = "";
</script>
<meta name="decorator" content="moduleList" />
</head>
<body>
	<form name="listForm"
		action="${contextPath}/biz/contract/assrecord/getList?navId=${navId}"
		id="associatedForm" method="post" class="form-inline" role="form">
		<ol class="breadcrumb map_1">
			<li><a href="${contextPath}/index">首页</a></li>
			<li><a
				href="${contextPath}/biz/intent/intAssociated/list?navId=${navId}">招商合约</a></li>
			<li class="active">意向洽谈列表</li>
		</ol>
		<input type="hidden" id="contractType" value="associated"> <input
			type="hidden" id="isListJsp" value="true">
		<div class="o-l-search-builder f_1">
			<div id="statement-search-builder" class="collapse" style="height: auto;">
	             <div class="f_3">
	                  <div class="form-group col-sm-6">
	                      <label for="inputtext3" class="col-sm-3 control-label f_4">区域：</label>
	                       <div class="col-sm-9 f_6">
	                       	<div class="input-group">
	                       		<input type="hidden" id="areaId"  name="assinfo.areaId" value="${assrecords.assinfo.areaId}"/> 
								<input type="text" class="f_5" id="area" readonly="readonly" name="assinfo.area" value="${assrecords.assinfo.area}">
								<span class="input-group-addon f_time"><a onclick="cleanArea()" href="javascript:void"><i class="glyphicon glyphicon-remove"></i></a></span>
								<span class="input-group-btn">
									<button class="btn btn-default btn_3" id="areaBtn"
									 type="button">选择</button>
									 </span>
							</div>
						 </div>
	                  </div>
	                  <div class="form-group col-sm-6">
	                      <label for="store" class="col-sm-3 control-label f_4">门店名：</label>
	                      <div class="col-sm-9 f_6">
	                        <select type="text" class="f_5" id="storeId" name="assinfo.storeId">
	                        	<c:if test="${empty assrecords.assinfo.storeId}">
	                        		<option value="" >---请选择---</option>
	                        	</c:if>
	                        	<c:if test="${not empty assrecords.assinfo.storeId}">
	                        		<option value="${assrecords.assinfo.storeId}" selected="selected" >${assrecords.assinfo.store}</option>
	                        	</c:if>
	                        </select>
	                        <input type="hidden"  id="store" name="assinfo.store" value="${assrecords.assinfo.store}"/>
	                      </div>
	                  </div>
	             </div>
	             <div class="f_3">
	                  <div class="form-group col-sm-6">
	                      <label for="floorId" class="col-sm-3 control-label f_7">楼层：</label>
	                      <div class="col-sm-9 f_6">
	                        <select type="email" class="f_5" id="floorId" name="assinfo.floorId">
	                        	<option value="" <c:if test="${not empty assrecords.assinfo.floorId}">selected=""</c:if>>---请选择---</option>
	                        	<c:if test="${not empty assrecords.assinfo.floorId}">
	                        		<option value="${assrecords.assinfo.floorId}" selected="selected">${assrecords.assinfo.floor}</option>
	                        	</c:if>
	                        </select>
	                        <input type="hidden" path="floor" id="floor" value="${assrecords.assinfo.floor}" name="assinfo.floor"/>
	                      </div>
	                  </div>
	                  <div class="form-group col-sm-6">
	                      <label for="contractAttribute" class="col-sm-3 control-label f_7">合同类型：</label>
	                      <div class="col-sm-9 f_6">
	                         <ossp:select dictType="CONTRACT_TYPE" class_="f_5" id="contractAttribute" name="assinfo.contractType" defaultSelected="${assrecords.assinfo.contractType}"></ossp:select>
	                      </div>
	                  </div>
	             </div>
	             <div class="f_2">
	                 <div class="form-group col-sm-6">
	                      <label for="contractStatus" class="col-sm-3 control-label f_7">洽谈状态：</label>
							
	                      <div class="col-sm-9 f_6">
	                          <ossp:select dictType="assrecord_status" class_="f_5" id="negotiationType" defaultSelected="${assrecords.assinfo.status }" name="assinfo.status"></ossp:select>
	                      </div>
	                  </div>
	                 <div class="form-group col-sm-6">
	                      <label for="contractStatus" class="col-sm-3 control-label f_7">原合同号：</label>
							
	                     <div class="col-sm-9 f_6">
						 	<input class="f_5" id="contractNo" name="assinfo.contractNo" value="${assrecords.assinfo.contractNo }" />
						</div>
	                 </div>
	             </div>
	             <div class="f_3">
	                 <div class="form-group col-sm-6">
	                      <label for="contractStatus" class="col-sm-3 control-label f_7">属性：</label>
							
	                      <div class="col-sm-9 f_6">
	                          <ossp:select dictType="CONTRATC_ATTRIBUTE" class_="f_5" id="negotiationType" defaultSelected="${assrecords.assinfo.negotiationType }" name="assinfo.negotiationType"></ossp:select>
	                      </div>
	                  </div>
	                 <div class="form-group col-sm-6">
	                      <label for="contractStatus" class="col-sm-3 control-label f_7">是否变更：</label>
							
	                     <div class="col-sm-9 f_6">
						 	<ossp:select dictType="YESORNO" class_="f_5" id="isModifyContract" defaultSelected="${assrecords.assinfo.isModifyContract }" name="assinfo.isModifyContract"></ossp:select>
						</div>
	                 </div>
	             </div>
	             <div class="f_2" style="display: none;">
	                 <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_4">开始时间：</label>
	                      <div class="col-sm-9 f_6">
	                        <div class="input-group date o-a-form-datetime" data-date="" data-date-format="yyyy-mm-dd">
	                            <input class="form-control f_13" type="text" readonly id="startDate" name="assinfo.startDate"/>
	                            <span class="input-group-addon f_time"><i class="glyphicon glyphicon-remove"></i></span>
	                            <span class="input-group-addon f_time"><span class="glyphicon glyphicon-calendar"></span></span>
	                        </div>
	                      </div>
	                  </div>
	                  <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_7">结束时间：</label>
	                      <div class="col-sm-9 f_6">
	                        <div class="input-group date o-a-form-datetime" data-date="" data-date-format="yyyy-mm-dd">
	                            <input class="form-control f_13" type="text" readonly id="endDate" name="assinfo.endDate"/>
	                            <span class="input-group-addon f_time"><i class="glyphicon glyphicon-remove"></i></span>
	                            <span class="input-group-addon f_time"><span class="glyphicon glyphicon-calendar"></span></span>
	                        </div>
	                      </div>
	                  </div>
	             </div>
			</div>
			<div class="f_8">
				<div class="f_2">
					<div class="col-sm-4 f_6">
						 <input class="f_5" id="nagNo" name="assinfo.number" placeholder="洽谈号" />
					</div>
					<div class="col-sm-4 f_6">
						 <input class="f_5" id="getBybrand" name="negAssbrands[0].brandCname" value="${brandCname}" placeholder="品牌中文名" />
					</div>
					<button type="submit" id="queryBtn" class="btn btn-warning btn_1">查&nbsp;&nbsp;询</button>
					<button type="button" onclick="cleanAll()" class="btn btn-warning btn_1">重&nbsp&nbsp;置</button>
				</div>
			</div>
			<div class="o-l-chevron-down">
				<a href="#" class="btn btn-default collapsed" data-toggle="collapse"
					data-target="#statement-search-builder" id="chevronDownBtn"
					role="button"><span id="glyphiconspan"
					class="glyphicon glyphicon-chevron-down"></span></a>
			</div>
		</div>
		
		<div class="o-l-search-builder f_1">
			<shiro:hasPermission name="com.maoye.ossp.biz.contract.Assrecords:delete">
			<button class="btn btn-danger btn_3 btn_right" type="button" onclick="Oosp_DelChked('${contextPath}/biz/contract/assrecord/ids/delete?navId=${navId}','table1','ids')">删除</button>
			<%-- <button class="btn btn-info btn_3 btn_right" type="button" onclick="funform('${contextPath}/biz/contract/assrecord/add?navId=${navId}','_self');">新建</button> --%>
			</shiro:hasPermission>
		</div>
		
		<tags:message content="${message}" />
		<div class="o-l-search-builder f_9">
			<table class="table table-striped table-hover o-l-table table-bordered" id="table1">
				<thead class="t_1">
					<tr>
						<th style="width: 1px"><input type="checkbox" data-ckb="all"></th>
						<th>单号</th>
						<th>门&nbsp&nbsp&nbsp&nbsp店</th>
						<th>品&nbsp&nbsp&nbsp&nbsp牌</th>
						<th>招商编号</th>
						<th>合同类型</th>
						<th>属&nbsp&nbsp性</th>
						<th>变&nbsp&nbsp更</th>
						<th>提交人</th>
						<th>提交时间</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${list}" var="assinfo">
						<tr data-herf="${contextPath}/biz/contract/assrecord/get?id=${assinfo.assrecords.id}&navId=${navId}" data-target="_self">
							<td class="o-l-tab-ckb"><input type="checkbox" data-ckb-id="${assinfo.id}"></td>
							<td>${assinfo.number}</td>
							<td title="${assinfo.store}"><div
									STYLE="width: 70px; overflow: hidden; text-overflow: ellipsis">
									<nobr>${assinfo.store}</nobr>
								</div></td>
								
							<td title='<c:forEach items="${assinfo.assrecords.negAssbrands }" var="assbrands">
									<c:if test="${assbrands.mainBrands != null && assbrands.mainBrands != ''}">
										${assbrands.brandCname }
									</c:if>
								</c:forEach>'>
								<div
									STYLE="width: 70px; overflow: hidden; text-overflow: ellipsis">
									<nobr>
								<c:forEach items="${assinfo.assrecords.negAssbrands }" var="assbrands">
									<c:if test="${assbrands.mainBrands != null && assbrands.mainBrands != ''}">
										${assbrands.brandCname }
									</c:if>
								</c:forEach></nobr></div>
							</td>
							
							<td title='<c:forEach items="${assinfo.assrecords.negAssshopsList }"
									var="assshop" varStatus="i">
									${fn:split(assshop.shopId, ".")[4]}	
									<c:if test="${fn:length(assinfo.assrecords.negAssshopsList) != i.count }">,</c:if>
								</c:forEach>'>
								<div
									STYLE="width: 70px; overflow: hidden; text-overflow: ellipsis">
									<nobr>
								<c:forEach items="${assinfo.assrecords.negAssshopsList }"
									var="assshop" varStatus="i">
									${fn:split(assshop.shopId, ".")[4]}	
									<c:if test="${fn:length(assinfo.assrecords.negAssshopsList) != i.count }">,</c:if>
								</c:forEach></nobr></div>
							</td>
							<td title='<ossp:value dictType="CONTRACT_TYPE" key="${assinfo.contractType}" />'>
								<div STYLE="width: 60px; overflow: hidden; text-overflow: ellipsis">
									<nobr><ossp:value dictType="CONTRACT_TYPE" key="${assinfo.contractType}" /></nobr>
								</div>
							</td>
									
							<td title='<ossp:value dictType="CONTRATC_ATTRIBUTE" key="${assinfo.negotiationType}" />'>
							     <div
									STYLE="width: 40px; overflow: hidden; text-overflow: ellipsis">
									<nobr><ossp:value dictType="CONTRATC_ATTRIBUTE" key="${assinfo.negotiationType}" /></nobr>
								</div>
							</td>
							<td title='<ossp:value dictType="YESORNO" key="${assinfo.isModifyContract}"></ossp:value>'><ossp:value dictType="YESORNO" key="${assinfo.isModifyContract}"></ossp:value></td>
							<td title="${assinfo.assrecords.createBy}"><div
									STYLE="width: 70px; overflow: hidden; text-overflow: ellipsis">
									<nobr>${assinfo.assrecords.createBy}</nobr></div>
							</td>
									
							<td title='<fmt:formatDate value="${assinfo.assrecords.createTime}" pattern="yyyy-MM-dd hh:mm:ss"/>'>
									<fmt:formatDate value="${assinfo.assrecords.createTime}" pattern="yyyy-MM-dd "/>
							 </td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}"
			url="" total="${page.total}" />
		<script type="text/javascript">
			$('.o-a-form-datetime').datetimepicker({
				language : 'zh-CN',
				weekStart : 1,
				todayBtn : 1,
				autoclose : 1,
				todayHighlight : 1,
				startView : 2,
				minView : 2,
				forceParse : 0,
				format : 'yyyy-mm-dd'
			});
		</script>

		<!-- Modal -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel" aria-hidden="true"></div>
		<script type="text/javascript" src="${staticPath}/js/list.js"></script>
	</form>
</body>

</html>